package com.yss.ams.demo.controller;

import com.yss.ams.demo.dao1.UserDao1;
import com.yss.ams.demo.dao2.UserDao2;
import com.yss.ams.demo.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shenyao
 * @date 2021/3/28
 * @description:
 */

@RestController
public class TestController {
    @Autowired
    UserDao1 userDao;
    @Autowired
    UserDao2 userDao2;


    @GetMapping("/testmuijpa")
    public void test1() {
        User u1 = new User();
        u1.setAge(55);
        u1.setName("鲁迅");
        u1.setGender("男");
        userDao.save(u1);
        User u2 = new User();
        u2.setAge(80);
        u2.setName("泰戈尔");
        u2.setGender("男");
        userDao2.save(u2);
    }

}
